package com.framework.loippi.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.framework.loippi.mybatis.eitity.GenericEntity;
import com.framework.loippi.mybatis.ext.annotation.Column;
import com.framework.loippi.mybatis.ext.annotation.Table;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Entity - 订单管理
 *
 * @author wmj
 * @version 2.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "T_ORDER")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
@ApiModel(value = "订单管理", description = "订单管理")
public class TOrder implements GenericEntity {

    private static final long serialVersionUID = 5081846432919091193L;

    /**
     * ID
     */
    @Column(id = true, name = "id", updatable = false)
    @ApiModelProperty(value = "ID")
    private Long id;

    /**
     * 订单号
     */
    @Column(name = "order_sn")
    @ApiModelProperty(value = "订单号")
    private String orderSn;

    /**
     * 店铺id
     */
    @Column(name = "shop_id")
    @ApiModelProperty(value = "店铺id")
    private Long shopId;

    /**
     * 用户id
     */
    @Column(name = "user_id")
    @ApiModelProperty(value = "用户id")
    private Long userId;

    /**
     * 药品数量
     */
    @Column(name = "medicine_count")
    @ApiModelProperty(value = "药品数量")
    private Integer medicineCount;

    /**
     * 订单总额
     */
    @Column(name = "amount")
    @ApiModelProperty(value = "订单总额")
    private java.math.BigDecimal amount;

    /**
     * 收货地区id
     */
    @Column(name = "address_id")
    @ApiModelProperty(value = "收货地区id")
    private Long addressId;

    /**
     * 收货地区名称
     */
    @Column(name = "area_name")
    @ApiModelProperty(value = "收货地区名称")
    private String areaName;

    /**
     * 收货人姓名
     */
    @Column(name = "user_name")
    @ApiModelProperty(value = "收货人姓名")
    private String userName;

    /**
     * 收货手机号
     */
    @Column(name = "phone")
    @ApiModelProperty(value = "收货手机号")
    private String phone;

    /**
     * 收货地址
     */
    @Column(name = "address_detail")
    @ApiModelProperty(value = "收货地址")
    private String addressDetail;

    /**
     * 订单类型（0-普通）
     */
    @Column(name = "order_type")
    @ApiModelProperty(value = "订单类型（0-普通）")
    private Integer orderType;

    /**
     * 订单状态（1-待支付，2-已支付/待发货，3-已发货/待收货, 4待评价/已收货，5-已完成，6-已取消，7-已关闭，8-售后中,9-售后完成）
     */
    @Column(name = "order_status")
    @ApiModelProperty(value = "订单状态（1-待支付，2-已支付/待发货，3-已发货/待收货, 4待评价/已收货，5-已完成，6-已取消，7-已关闭，8-售后中,9-售后完成）")
    private Integer orderStatus;

    /**
     * 运费
     */
    @Column(name = "freight")
    @ApiModelProperty(value = "运费")
    private java.math.BigDecimal freight;

    /**
     * 优惠金额
     */
    @Column(name = "discount_amount")
    @ApiModelProperty(value = "优惠金额")
    private java.math.BigDecimal discountAmount;

    /**
     * 实付金额
     */
    @Column(name = "real_amount")
    @ApiModelProperty(value = "实付金额")
    private java.math.BigDecimal realAmount;

    /**
     * 下单时间
     */
    @Column(name = "order_time")
    @ApiModelProperty(value = "下单时间")
    private java.util.Date orderTime;

    /**
     * 支付时间
     */
    @Column(name = "pay_time")
    @ApiModelProperty(value = "支付时间")
    private java.util.Date payTime;

    /**
     * 发货时间
     */
    @Column(name = "send_time")
    @ApiModelProperty(value = "发货时间")
    private java.util.Date sendTime;

    /**
     * 收货时间
     */
    @Column(name = "receive_time")
    @ApiModelProperty(value = "收货时间")
    private java.util.Date receiveTime;

    /**
     * 快递单号
     */
    @Column(name = "logistics_number")
    @ApiModelProperty(value = "快递单号")
    private String logisticsNumber;

    /**
     * 支付流水号
     */
    @Column(name = "pay_sn")
    @ApiModelProperty(value = "支付流水号")
    private String paySn;

    /**
     * 支付方式（1-微信，2-支付宝，3-其他，4-房间挂账）
     */
    @Column(name = "pay_type")
    @ApiModelProperty(value = "支付方式（1-微信，2-支付宝，3-其他，4-房间挂账）")
    private Integer payType;

    /**
     * 售后申请时间
     */
    @Column(name = "aftersale_apply_time")
    @ApiModelProperty(value = "售后申请时间")
    private java.util.Date aftersaleApplyTime;

    /**
     * 售后处理时间
     */
    @Column(name = "aftersale_deal_time")
    @ApiModelProperty(value = "售后处理时间")
    private java.util.Date aftersaleDealTime;

    /**
     * 售后状态（1非售后, 2-售后）
     */
    @Column(name = "aftersale_status")
    @ApiModelProperty(value = "售后状态（1非售后, 2-售后）")
    private Integer aftersaleStatus;

    /**
     * 卖家备注
     */
    @Column(name = "seller_remark")
    @ApiModelProperty(value = "卖家备注")
    private String sellerRemark;

    /**
     * 买家备注
     */
    @Column(name = "buyer_remark")
    @ApiModelProperty(value = "买家备注")
    private String buyerRemark;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private java.util.Date updateTime;

    /**
     * 物流简称
     */
    @Column(name = "ship_company")
    @ApiModelProperty(value = "物流简称")
    private String shipCompany;

    /**
     * 物流公司id
     */
    @Column(name = "logistics_id")
    @ApiModelProperty(value = "物流公司id")
    private Long logisticsId;

    /**
     * 物流公司名称
     */
    @Column(name = "logistics_company")
    @ApiModelProperty(value = "物流公司名称")
    private String logisticsCompany;

    /**
     * 完成时间
     */
    @Column(name = "finish_time")
    @ApiModelProperty(value = "完成时间")
    private java.util.Date finishTime;

    /**
     * 支付终端(退款使用 0-默认 1-app 2-公众号 3-小程序)
     */
    @Column(name = "type")
    @ApiModelProperty(value = "支付终端(退款使用 0-默认 1-app 2-公众号 3-小程序)")
    private Integer type;

    /**
     * 支付状态
     */
    @Column(name = "payStatus")
    @ApiModelProperty(value = "支付状态")
    private Integer payStatus;

    /**
     * 订单状态
     */
    @Column(name = "status")
    @ApiModelProperty(value = "订单状态")
    private Integer status;

    /**
     * 物流信息
     */
    @ApiModelProperty(value = "物流信息")
    private TLogistics logistics;

    /**
     * 用户信息
     */
    @ApiModelProperty(value = "用户信息")
    private TUser user;

    /**
     * 订单对应的商品列表
     */
    @ApiModelProperty(value = "商品列表")
    private List<OrderItem> items;

    /**
     * 订单最新物流信息
     */
    @Column(name = "logistics_content")
    @ApiModelProperty(value = "订单最新物流信息")
    private String logisticsContent;


    /**
     * 推荐人id
     */
    @Column(name = "recommend_id")
    @ApiModelProperty(value = "推荐人id")
    private Long recommendId;
}
